#include <iostream>
#include <stdio.h>
#include <math.h>
#include <vector>

using namespace std;

int func(int m, int x);
bool iszc(int num1, int num2);
int findA1(int m, int n);

int main()
{
    FILE *fp = fopen("func.in", "r");
    FILE *fc = fopen("func.out", "w");

    int m,n;
    fscanf(fp, "%d %d", &m, &n);

    vector<int> numlist;
    for (int i = 1; i < m*m*m*m; i++)
    {
        if (findA1(i, n) != 0)
        {
            numlist.push_back(i);
        }
    }
    
    fprintf(fc, "%d\n", numlist.size()+5);

    fclose(fp);
    fclose(fc);

    return 0;
}

//判断num1能否整除num2
bool iszc(int num1, int num2)
{
    if(num1 % num2 == 0)
        return true;
    else
        return false;
}

//求函数值
int func(int m, int x)
{
    if (iszc(m, x))
        return m/x;
    else
        return m+1;
}

//找到经过n次函数运算后等于1的数
int findA1(int m, int n)
{
    int x=1;
    for(int i=0; i<n; i++)
    {
        x = func(m, x);
    }
    if (x==1) return x;
    else return 0;
}